<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/auth/templates/template.xhtml">
	<ui:define name="pageTitle">Transfer&ecirc;ncia Em Contas</ui:define>
	<ui:define name="body">
		<f:view>
			<p:growl id="messages" autoUpdate="true" closable="true" />
			<h:form>
				<h:panelGrid id="dados" cellspacing="10px" styleClass="center">
					<f:facet name="header">Transfer&ecirc;ncia Em Contas</f:facet>
					<h:outputText value="Dados da Transferência" styleClass="header3" />
					<h:panelGrid columns="2" cellspacing="10px">
						<p:outputLabel value="Despesa Origem:" for="txtDespesaOrigem" />
						<p:selectOneMenu id="txtDespesaOrigem"
							value="#{transacaoRSBean.idDespesaOrigem}">
							<f:selectItem itemLabel="Selecione uma Despesa" />
							<f:selectItems value="#{despesaBean.despesasComCartao}"
								itemValue="#{d.idDespesa}" itemLabel="#{d.descricao}" var="d" />
						</p:selectOneMenu>
						<p:outputLabel value="Despesa Destino:" for="txtDespesaDestino" />
						<p:selectOneMenu id="txtDespesaDestino"
							value="#{transacaoRSBean.idDespesaDestino}">
							<f:selectItem itemLabel="Selecione uma Despesa" />
							<f:selectItems value="#{despesaBean.despesasComCartao}"
								itemValue="#{d.idDespesa}" itemLabel="#{d.descricao}" var="d" />
						</p:selectOneMenu>
						<p:outputLabel value="Histórico" for="txtHistorico" />
						<p:inputText id="txtHistorico"
							value="#{transacaoRSBean.historico}" />
						<p:outputLabel value="Valor" for="txtValor" />
						<p:inputText id="txtValor"
							value="#{transacaoRSBean.valorTransferencia}">
							<f:convertNumber minFractionDigits="2" type="number" />
						</p:inputText>
					</h:panelGrid>
					<p:commandButton
						action="#{transacaoRSBean.transferenciaEntreContas()}"
						value="Enviar" update="dados"
						onclick="if(!confirm('Deseja realmente realizar esta transferência?')) return false;"
						icon="ui-icon-check" />
				</h:panelGrid>
			</h:form>
		</f:view>
	</ui:define>
</ui:composition>

</html>